<template>
  <div>
    <nav-bar title=""></nav-bar>
    <img class="img-style" :src="certificateUrl" />
  </div>
</template>
<script>
import navBar from "@/components/NavBar";
export default {
  components:{
    navBar
  },
  name: "showCertificate",
  data() {
    return {
      certificateUrl:'',
      imgUrl: config.imgUrl,
    };
  },
  methods: {
    findCertificate(certificateId){
      this.$request({
        url: "/certificate/findCertificateById",
        data: { certificateId: certificateId },
        method: "post",
      }).then((rsp) => {
        if (rsp.code === 200) {
          this.certificateUrl = rsp.data.imgUrl;
        } else {
          this.$toast.fail(rsp.content);
        }
      });
    }
  },
  mounted() {
    let certificateId = this.$route.query.certificateId
    this.findCertificate(certificateId);
  },
};
</script>
<style scoped>
.img-style{
  width:100%;
  margin:20px auto;
}
</style>
